How to setup Caddy
- Setting up Caddy
- Setting Up Cloudflare Tunnels
Setting up Caddy
Caddyfile Download
Running Caddy inside the Caddy.exe Directory
cd C:\Caddy\Directory
ie. cd C:\Tools\Caddy
- Running Caddy Manually
./caddy run --config Caddyfile
Do not Forget to Accept both permissions if a windows Pops up upon first run.
Setting Up Cloudflare Tunnels
Downloads
Setting up A Name Record
-
Download Cloudflare DDNS from github and extract it to a directory of your choice ie.
C:\Tools\CloudflareDDNS
-
Open https://dash.cloudflare.com/ and select your domain
-
Click DNS on the side bar
- Click add a Record
- Go to https://ipchicken.com/ and copy your external ip into the A NAME ie.
- Click Save
Getting an API Key
- Go to Overview in the right Hand Menu
- Scroll Down till you see get API Token and click it
- Click Create a Token
- Scroll down and select Custom Token
- Name the Token, Give it Zone, Zone, Read and then click add more and add Zone, DNS, Edit Like so
-
Then Click Create Token
-
Create Copy your token somewhere safe
Running Cloudflare DDNS
- type in powershell
cd C:\Tools\CloudflareDDNS
- Run this command after you edit the code to match yours
./cloudflare-ddns --token your-cloudflare-api-key --domain home.yourdomain.com
ie.
./cloudflare-ddns --token apkGKJHDkansjhcbsdjhc --domain home.demonwarriortech.com
- it should get a log like this
time="2023-01-28T17:54:39-06:00" level=info msg="updated record" content=123.123.123.123 name=home.ittechnut.com
PS C:\tools\cloudflareddns>
Autostartup CloudflareDDNS
- Search Run in Windows
-
Type
shell:startup
and enter it will open a folder with your startup apps. These are all the apps that start when windows Starts -
Right Click anywhere in empty space in your folder and click new ---> Text Documents and name it CloudFlareDDNS.bat (Make sure You do Not save it as a .txt)
- Now open the text document and paste
C:\Tools\CloudFlareDDNS\cloudflare-ddns --token your-cloudflare-api-token--domain home.yourdomain.com
pause
ie.
C:\Tools\CloudFlareDDNS\cloudflare-ddns --token apkGKJHDkansjhcbsdjhc --domain home.demonwarriortech.com
pause
-
Click Save or CTRL+S
-
Run it and it should now be autorunning your background